package com.monkey.luffer.springboot.demo.basis.example;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

import java.util.Date;


/**
 * @Author: dengkaibing
 * @Description:
 * @Date: 2020/12/30 17:02
 * @company 甜橙金融
 * @Version: 1.0
 */
@Data
@Builder
@AllArgsConstructor
public class User implements Comparable<User> {
    private String name;
    private int age;
    private Date created;

    public User(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public User() {
    }

    @Override
    public int compareTo(User o) {
        return this.getAge()-o.getAge();
    }
}
